import inspect

base_instance_count = 0

class Base(object):
	def __new__(cls, *args, **kwargs):
		o = object.__new__(cls)
		global base_instance_count
		o.__instance_id__ = base_instance_count
		base_instance_count += 1
		return o

class Variable(Base):
	def __init__(self, value = None, const = False, static = False, comment = None):
		self.value = value
		self.const = const
		self.static = static
		self.comment = comment

# Basic types
class Bool(Variable):
	def __init__(self, value = None, const = False, static = False, comment = None):
		super(Bool, self).__init__(value, const, static, comment)

class Float(Variable):
	def __init__(self, value = None, const = False, static = False, comment = None):
		super(Float, self).__init__(value, const, static, comment)

class Int32(Variable):
	def __init__(self, value = None, const = False, static = False, comment = None):
		super(Int32, self).__init__(value, const, static, comment)

class String(Variable):
	def __init__(self, value = None, const = False, static = False, comment = None):
		super(String, self).__init__(value, const, static, comment)

# Pointer
class RawPointer(Variable):
	def __init__(self, type, value = None, const = False, static = False, comment = None):
		super(RawPointer, self).__init__(value, const, static, comment)
		self.type = type

class SharedPointer(Variable):
	def __init__(self, type, value = None, const = False, static = False, comment = None):
		super(SharedPointer, self).__init__(value, const, static, comment)
		self.type = type

# Containers
class Array(Base):
	def __init__(self, type, count):
		self.type = type
		self.count = count

# Enum
class Enum(Base):
	def __init__(self, __comment__ = '', **kwargs):
		self.comment = __comment__
		self.items = {}
		for key in kwargs.keys():
			self.items[key] = kwargs[key]

class EnumItem(Base):
	def __init__(self, value = None, comment = None):
		self.value = value
		self.comment = comment

# Object
class Object(Base):
	pass

class SharedObject(Base):
	pass

class AddressOf(Base):
	def __init__(self, object, comment = None):
		self.object = object
		self.comment = comment
